<template>
  <!-- <van-steps
      :steps=" steps "
      :active=" active "
      direction="vertical"
      active-color="#187798"
      active-icon="success"
      inactive-icon="circle"
  />-->
  <div class="main" v-if="steps.length>0">
    <div v-for="(item,index) in steps" :key="index">
      <div class="flex steps">
        <img v-if="index===0" class="icon" src="/static/images/icon_true.png" alt />
        <p v-else class="circle"></p>
        <span class="time">{{item.time}}</span>
      </div>
      <div class="flex">
        <div class="left">
          <p v-if="index!==steps.length-1"></p>
        </div>
        <div class="flex-1 name">{{item.context}}</div>
      </div>
    </div>
  </div>
  <div v-else>
    <notDatas item="暂无物流消息" />
  </div>
</template>

<script>
import { logisticsOrder } from '@/api/api';
import notDatas from '@/components/notDatas';
export default {
  props: {},
  data () {
    return {
      steps: []
    };
  },
  computed: {},
  components: { notDatas },
  created () {},
  mounted () {
    this.id = this.$root.$mp.query.id;
    this.info();
  },
  watch: {},
  methods: {
    /** 物流信息 */
    async info () {
      await logisticsOrder({ id: this.id }).then(res => {
        console.log(res);
        if (!res.code) {
          this.steps = res;
        }
      });
    }
  }
};
</script>

<style scoped lang="less">
.main {
  padding: 15px 19px;
  .circle {
    width: 14px;
    margin-right: 13px;
    height: 14px;
    border: 2px solid #a1bdc9;
    border-radius: 50%;
  }
  .left {
    width: 20px;
    margin-right: 13px;
    padding: 7px 0 4px 0;
    text-align: center;
    p {
      width: 2px;
      height: 46px;
      border-left: 2px dashed #a1bdc9;
      margin: auto;
    }
  }
  .name {
    color: #909292;
    padding-top: 3px;
    font-size: 12px;
  }
  .time {
    font-weight: bold;
    font-size: 15px;
    color: #020604;
  }
  .icon {
    margin-right: 13px;
    width: 20px;
    height: 20px;
  }
}
</style>
